local skel = fk.CreateSkill{
  name = "laying_down_skill",
}
local isAlly = function (player, target)
  if player == target then
    return false
  end
  local role1, role2 = player.role, target.role
  local dict = { "lord", "loyalist" }
  return role1 == role2 or (table.contains(dict, role1) and table.contains(dict, role2))
end
Fk:loadTranslationTable{
  ["laying_down_skill"] = "躺赢",
  [":laying_down_skill"] = "躺赢",
  ["#laying_down_skill"] = "结束当前回合并为队友带来增益",
  ["@@laying_down"] = "躺赢",
}
---@type CardSkillSpec
local laying_down = {
  prompt = "#laying_down_skill",
  mod_target_filter = Util.TrueFunc,
  can_use = Util.CanUseToSelf,
  on_effect = function(self, room, effect)
    if effect.to.dead then return end
    local targets = room:getOtherPlayers(effect.to)
    room:sortByAction(targets)
    local to = table.find(targets, function (p)
      return isAlly(effect.to, p)
    end)
    if to then
      room:setPlayerMark(to, "@@laying_down", 1)
    end
    room:endTurn()
  end,
}
skel:addEffect("cardskill", laying_down)
return skel